/*package com.yizhengqiyuan.util.fastdfs;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import com.github.tobato.fastdfs.domain.StorePath;
import com.github.tobato.fastdfs.exception.FdfsUnsupportStorePathException;
import com.github.tobato.fastdfs.proto.storage.DownloadCallback;
import com.github.tobato.fastdfs.service.FastFileStorageClient;

*//**
 * <p>Description: FastDFS文件上传下载包装类</p>
 * <p>Copyright: Copyright (c) 2017</p>
 *
 * @author sk
 * @version 1.0
 * @date 2017/6/1
 *//*
@Component
public class FastDFSClientWrapper {

    private final Logger logger = LoggerFactory.getLogger(FastDFSClientWrapper.class);

    @Autowired
    private FastFileStorageClient storageClient;
    *//**
     * 上传文件
     * @param file 文件对象
     * @return 文件访问地址
     * @throws IOException
     *//*
    public String uploadFile(MultipartFile file) throws IOException {
        StorePath storePath = storageClient.uploadFile(file.getInputStream(),file.getSize(), FilenameUtils.getExtension(file.getOriginalFilename()),null);
        return storePath.getFullPath();
    }

    *//**
     * 删除文件
     * @param fileUrl 文件访问地址
     * @return
     *//*
    public void deleteFile(String fileUrl) {
        if (StringUtils.isEmpty(fileUrl)) {
            return;
        }
        try {
            StorePath storePath = StorePath.praseFromUrl(fileUrl);
            storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
        } catch (FdfsUnsupportStorePathException e) {
            logger.warn(e.getMessage());
        }
    }



}
*//**
 * 下载不走这个
 * @author suke
 *
 *//*
class MyDownloadCallback implements DownloadCallback {

	@Override
	public Object recv(InputStream ins) throws IOException {
		FileOutputStream fos = new FileOutputStream("D:/b.jpg");

		byte[] b = new byte[1024];

		while((ins.read(b)) != -1){
			fos.write(b);
		}
		fos.close();
		return "";
	}

}
*/





